package com.gui.util;

/**
 * Created by Gui on 2017/7/22.
 */
public enum  ReplyType {

    STATUS('+'), ERROR('-'), INTEGER(':'), BULK('$'), MULTI('*');

    public char value;
    private ReplyType(char value) {
        this.value = value;
    }

    public static ReplyType forValue(char value) {
        switch (value) {
            case '+':
                return ReplyType.STATUS;
            case '-':
                return ReplyType.ERROR;
            case ':':
                return ReplyType.INTEGER;
            case '$':
                return ReplyType.BULK;
            case '*':
                return ReplyType.MULTI;
            default:
                return null;
        }
    }

}
